package dn.controller;

import dn.common.BaseResultModel;
import dn.entity.User;
import dn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/add")
    public @ResponseBody BaseResultModel AddUser(){
        User user = new User( "ytt", 23, "山东");
        BaseResultModel result = userService.addUser(user);
       return result;
    }

}
